#tag WindowBegin Window DnBXMLParser   BackColor       =   &hFFFFFF   Backdrop        =   ""   CloseButton     =   True   Composite       =   False   Frame           =   0   FullScreen      =   False   HasBackColor    =   False   Height          =   280   ImplicitInstance=   True   LiveResize      =   False   MacProcID       =   0   MaxHeight       =   32000   MaximizeButton  =   False   MaxWidth        =   32000   MenuBar         =   ""   MenuBarVisible  =   True   MinHeight       =   64   MinimizeButton  =   False   MinWidth        =   64   Placement       =   0   Resizeable      =   False   Title           =   "DnB Lead Processor"   Visible         =   True   Width           =   400   Begin PagePanel PagePanel1      AutoDeactivate  =   True      Enabled         =   True      Height          =   280      HelpTag         =   ""      Index           =   -2147483648      InitialParent   =   ""      Left            =   0      LockBottom      =   ""      LockedInPosition=   False      LockLeft        =   True      LockRight       =   ""      LockTop         =   True      PanelCount      =   5      Panels          =   ""      Scope           =   0      TabIndex        =   0      TabPanelIndex   =   0      Top             =   0      Value           =   0      Visible         =   True      Width           =   400      Begin Label Label1         AutoDeactivate  =   True         Bold            =   True         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Multiline       =   ""         Scope           =   0         Selectable      =   False         TabIndex        =   0         TabPanelIndex   =   1         Text            =   "Step 1: Select source XML file"         TextAlign       =   0         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   14         Transparent     =   False         Underline       =   ""         Visible         =   True         Width           =   360      End      Begin TextField TextField1         AcceptTabs      =   ""         Alignment       =   0         AutoDeactivate  =   True         BackColor       =   &hFFFFFF         Bold            =   ""         Border          =   True         CueText         =   ""         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Format          =   ""         Height          =   22         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LimitText       =   0         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Mask            =   ""         Password        =   ""         ReadOnly        =   ""         Scope           =   0         TabIndex        =   1         TabPanelIndex   =   1         TabStop         =   True         Text            =   ""         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   75         Underline       =   ""         UseFocusRing    =   True         Visible         =   True         Width           =   337      End      Begin PushButton pg0next         AutoDeactivate  =   True         Bold            =   ""         ButtonStyle     =   0         Cancel          =   ""         Caption         =   "Next"         Default         =   True         Enabled         =   False         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   300         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         TabIndex        =   2         TabPanelIndex   =   1         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   240         Underline       =   ""         Visible         =   True         Width           =   80      End      Begin PushButton pg0cancel         AutoDeactivate  =   True         Bold            =   ""         ButtonStyle     =   0         Cancel          =   True         Caption         =   "Cancel"         Default         =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   208         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         TabIndex        =   3         TabPanelIndex   =   1         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   240         Underline       =   ""         Visible         =   True         Width           =   80      End      Begin Label pg0status         AutoDeactivate  =   True         Bold            =   ""         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   True         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Multiline       =   ""         Scope           =   0         Selectable      =   False         TabIndex        =   4         TabPanelIndex   =   1         Text            =   ""         TextAlign       =   0         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   10         TextUnit        =   0         Top             =   135         Transparent     =   False         Underline       =   ""         Visible         =   True         Width           =   368      End      Begin BevelButton pg0browse         AcceptFocus     =   False         AutoDeactivate  =   True         BackColor       =   "&c000000"         Bevel           =   0         Bold            =   False         ButtonType      =   0         Caption         =   "..."         CaptionAlign    =   3         CaptionDelta    =   0         CaptionPlacement=   1         Enabled         =   True         HasBackColor    =   False         HasMenu         =   0         Height          =   22         HelpTag         =   ""         Icon            =   ""         IconAlign       =   0         IconDX          =   0         IconDY          =   0         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   False         Left            =   358         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         MenuValue       =   0         Scope           =   0         TabIndex        =   5         TabPanelIndex   =   1         TabStop         =   True         TextColor       =   "&c000000"         TextFont        =   "System"         TextSize        =   ""         TextUnit        =   0         Top             =   75         Underline       =   False         Value           =   False         Visible         =   True         Width           =   30      End      Begin Label Label2         AutoDeactivate  =   True         Bold            =   True         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Multiline       =   ""         Scope           =   0         Selectable      =   False         TabIndex        =   0         TabPanelIndex   =   2         Text            =   "Step 2: Select roles to import as separate leads"         TextAlign       =   0         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   14         Transparent     =   False         Underline       =   ""         Visible         =   True         Width           =   360      End      Begin Listbox roleLB         AutoDeactivate  =   True         AutoHideScrollbars=   True         Bold            =   ""         Border          =   True         ColumnCount     =   2         ColumnsResizable=   ""         ColumnWidths    =   "10%,90%"         DataField       =   ""         DataSource      =   ""         DefaultRowHeight=   -1         Enabled         =   True         EnableDrag      =   ""         EnableDragReorder=   ""         GridLinesHorizontal=   0         GridLinesVertical=   0         HasHeading      =   ""         HeadingIndex    =   -1         Height          =   182         HelpTag         =   ""         Hierarchical    =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         InitialValue    =   ""         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         RequiresSelection=   ""         Scope           =   0         ScrollbarHorizontal=   ""         ScrollBarVertical=   True         SelectionType   =   0         TabIndex        =   1         TabPanelIndex   =   2         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   46         Underline       =   ""         UseFocusRing    =   True         Visible         =   True         Width           =   360         _ScrollWidth    =   -1      End      Begin PushButton pg1next         AutoDeactivate  =   True         Bold            =   ""         ButtonStyle     =   0         Cancel          =   ""         Caption         =   "Next"         Default         =   True         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   300         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         TabIndex        =   2         TabPanelIndex   =   2         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   240         Underline       =   ""         Visible         =   True         Width           =   80      End      Begin PushButton pg1back         AutoDeactivate  =   True         Bold            =   ""         ButtonStyle     =   0         Cancel          =   ""         Caption         =   "Back"         Default         =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   208         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         TabIndex        =   3         TabPanelIndex   =   2         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   240         Underline       =   ""         Visible         =   True         Width           =   80      End      Begin Label Label3         AutoDeactivate  =   True         Bold            =   True         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Multiline       =   ""         Scope           =   0         Selectable      =   False         TabIndex        =   0         TabPanelIndex   =   3         Text            =   "Step 3: Define output file options"         TextAlign       =   0         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   14         Transparent     =   False         Underline       =   ""         Visible         =   True         Width           =   360      End      Begin PushButton pg2back         AutoDeactivate  =   True         Bold            =   ""         ButtonStyle     =   0         Cancel          =   ""         Caption         =   "Back"         Default         =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   208         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         TabIndex        =   2         TabPanelIndex   =   3         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   240         Underline       =   ""         Visible         =   True         Width           =   80      End      Begin CheckBox optionUTF8         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "Create CSV using UTF8 encoding"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   3         TabPanelIndex   =   3         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   46         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   360      End      Begin CheckBox optionIntlPhone         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "Use Intl. phone number format (358 45 123 4567)"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   4         TabPanelIndex   =   3         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   70         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   360      End      Begin CheckBox optionShorten         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "Shorten country names (Denmark > DK)"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   5         TabPanelIndex   =   3         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   94         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   360      End      Begin CheckBox optionRound         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "Round currency values to nearest million"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   7         TabPanelIndex   =   3         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   118         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   360      End      Begin Label Label4         AutoDeactivate  =   True         Bold            =   ""         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   29         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   True         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Multiline       =   True         Scope           =   0         Selectable      =   False         TabIndex        =   6         TabPanelIndex   =   1         Text            =   "(You can also drag'n'drop the file into this window)"         TextAlign       =   0         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   46         Transparent     =   False         Underline       =   ""         Visible         =   True         Width           =   368      End      Begin CheckBox optionCountryZip         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "Add Country code in ZIP (FI00230)"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   8         TabPanelIndex   =   3         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   141         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   360      End      Begin CheckBox optionPopuEmpty         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "Write ""Not available"" on empty last name field"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   9         TabPanelIndex   =   3         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   164         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   360      End      Begin Label Label5         AutoDeactivate  =   True         Bold            =   True         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Multiline       =   ""         Scope           =   0         Selectable      =   False         TabIndex        =   0         TabPanelIndex   =   4         Text            =   "Step 4: Define target segment(s)"         TextAlign       =   0         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   14         Transparent     =   False         Underline       =   ""         Visible         =   True         Width           =   360      End      Begin PushButton pg3back         AutoDeactivate  =   True         Bold            =   ""         ButtonStyle     =   0         Cancel          =   ""         Caption         =   "Back"         Default         =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   208         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         TabIndex        =   2         TabPanelIndex   =   4         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   240         Underline       =   ""         Visible         =   True         Width           =   80      End      Begin PushButton pg2next         AutoDeactivate  =   True         Bold            =   ""         ButtonStyle     =   0         Cancel          =   ""         Caption         =   "Next"         Default         =   True         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   300         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         TabIndex        =   10         TabPanelIndex   =   3         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   240         Underline       =   ""         Visible         =   True         Width           =   80      End      Begin CheckBox segm1         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "P2P"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   3         TabPanelIndex   =   4         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   46         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   100      End      Begin CheckBox segm2         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "O2C"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   4         TabPanelIndex   =   4         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   66         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   100      End      Begin CheckBox segm3         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "SSC"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   5         TabPanelIndex   =   4         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   86         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   100      End      Begin CheckBox segm4         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "iPost"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   6         TabPanelIndex   =   4         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   106         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   100      End      Begin CheckBox segm5         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "Alligator"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   7         TabPanelIndex   =   4         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   126         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   100      End      Begin CheckBox CheckAll         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "All"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   4         TabPanelIndex   =   2         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   240         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   58      End      Begin PopupMenu bGroupMenu         AutoDeactivate  =   True         Bold            =   ""         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         InitialValue    =   "MC/Itella Posti\rMC/CRMarketing\rInformation\rLogistics"         Italic          =   ""         Left            =   147         ListIndex       =   0         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         TabIndex        =   8         TabPanelIndex   =   4         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   208         Underline       =   ""         Visible         =   True         Width           =   141      End      Begin Label Label6         AutoDeactivate  =   True         Bold            =   ""         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Multiline       =   ""         Scope           =   0         Selectable      =   False         TabIndex        =   9         TabPanelIndex   =   4         Text            =   "Business Group:"         TextAlign       =   0         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   208         Transparent     =   False         Underline       =   ""         Visible         =   True         Width           =   115      End      Begin PushButton pg4finish         AutoDeactivate  =   True         Bold            =   ""         ButtonStyle     =   0         Cancel          =   ""         Caption         =   "Finish"         Default         =   True         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   307         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         TabIndex        =   0         TabPanelIndex   =   5         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   240         Underline       =   ""         Visible         =   True         Width           =   80      End      Begin PushButton pg4back         AutoDeactivate  =   True         Bold            =   ""         ButtonStyle     =   0         Cancel          =   ""         Caption         =   "Back"         Default         =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   208         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         TabIndex        =   1         TabPanelIndex   =   5         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   240         Underline       =   ""         Visible         =   True         Width           =   80      End      Begin PushButton pg3next         AutoDeactivate  =   True         Bold            =   ""         ButtonStyle     =   0         Cancel          =   ""         Caption         =   "Next"         Default         =   True         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   300         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         TabIndex        =   10         TabPanelIndex   =   4         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   240         Underline       =   ""         Visible         =   True         Width           =   80      End      Begin Label Label7         AutoDeactivate  =   True         Bold            =   True         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Multiline       =   ""         Scope           =   0         Selectable      =   False         TabIndex        =   2         TabPanelIndex   =   5         Text            =   "Step 5: Define existing segments"         TextAlign       =   0         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   14         Transparent     =   False         Underline       =   ""         Visible         =   True         Width           =   360      End      Begin TextField TextField2         AcceptTabs      =   ""         Alignment       =   0         AutoDeactivate  =   True         BackColor       =   &hFFFFFF         Bold            =   ""         Border          =   True         CueText         =   ""         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Format          =   ""         Height          =   22         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LimitText       =   0         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Mask            =   ""         Password        =   ""         ReadOnly        =   ""         Scope           =   0         TabIndex        =   3         TabPanelIndex   =   5         TabStop         =   True         Text            =   ""         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   109         Underline       =   ""         UseFocusRing    =   True         Visible         =   True         Width           =   337      End      Begin BevelButton pg4browse         AcceptFocus     =   False         AutoDeactivate  =   True         BackColor       =   "&c000000"         Bevel           =   0         Bold            =   False         ButtonType      =   0         Caption         =   "..."         CaptionAlign    =   3         CaptionDelta    =   0         CaptionPlacement=   1         Enabled         =   True         HasBackColor    =   False         HasMenu         =   0         Height          =   22         HelpTag         =   ""         Icon            =   ""         IconAlign       =   0         IconDX          =   0         IconDY          =   0         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   False         Left            =   357         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         MenuValue       =   0         Scope           =   0         TabIndex        =   4         TabPanelIndex   =   5         TabStop         =   True         TextColor       =   "&c000000"         TextFont        =   "System"         TextSize        =   ""         TextUnit        =   0         Top             =   109         Underline       =   False         Value           =   False         Visible         =   True         Width           =   30      End      Begin Label pg4status         AutoDeactivate  =   True         Bold            =   ""         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   True         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Multiline       =   ""         Scope           =   0         Selectable      =   False         TabIndex        =   5         TabPanelIndex   =   5         Text            =   ""         TextAlign       =   0         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   10         TextUnit        =   0         Top             =   143         Transparent     =   False         Underline       =   ""         Visible         =   True         Width           =   368      End      Begin ProgressBar pg4prog         AutoDeactivate  =   True         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Maximum         =   100         Scope           =   0         TabPanelIndex   =   5         Top             =   77         Value           =   0         Visible         =   True         Width           =   367      End      Begin Label Label8         AutoDeactivate  =   True         Bold            =   ""         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Multiline       =   ""         Scope           =   0         Selectable      =   False         TabIndex        =   7         TabPanelIndex   =   1         Text            =   "Owner ID:"         TextAlign       =   0         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   187         Transparent     =   False         Underline       =   ""         Visible         =   True         Width           =   100      End      Begin TextField ownerIdTF         AcceptTabs      =   ""         Alignment       =   0         AutoDeactivate  =   True         BackColor       =   &hFFFFFF         Bold            =   ""         Border          =   True         CueText         =   ""         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Format          =   ""         Height          =   22         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   148         LimitText       =   0         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Mask            =   ""         Password        =   ""         ReadOnly        =   ""         Scope           =   0         TabIndex        =   8         TabPanelIndex   =   1         TabStop         =   True         Text            =   ""         TextColor       =   &h000000         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   186         Underline       =   ""         UseFocusRing    =   True         Visible         =   True         Width           =   240      End      Begin CheckBox RemoveCommas         AutoDeactivate  =   True         Bold            =   ""         Caption         =   "Remove Commas"         DataField       =   ""         DataSource      =   ""         Enabled         =   True         Height          =   20         HelpTag         =   ""         Index           =   -2147483648         InitialParent   =   "PagePanel1"         Italic          =   ""         Left            =   20         LockBottom      =   ""         LockedInPosition=   False         LockLeft        =   True         LockRight       =   ""         LockTop         =   True         Scope           =   0         State           =   0         TabIndex        =   9         TabPanelIndex   =   1         TabStop         =   True         TextFont        =   "System"         TextSize        =   0         TextUnit        =   0         Top             =   103         Underline       =   ""         Value           =   False         Visible         =   True         Width           =   360      End   EndEnd#tag EndWindow#tag WindowCode	#tag Event		Sub DropObject(obj As DragItem, action As Integer)		  if obj.FolderItemAvailable() then		    		    SELECT CASE obj.FolderItem.Type		      		    CASE FileTypes1.ApplicationXml.Name		      		      TextField1.text=obj.FolderItem.AbsolutePath		      		      source=GetFolderitem(obj.FolderItem.AbsolutePath)		      		      if source<>nil then		        		        pg0status.Text="Parsing "+source.name+", please wait..."		        		        self.Refresh		        		        do		          		        loop until ParseDnbXml(source)		        		        pg0status.Text="File has "+str(DnbDataArray.Ubound+1)+" records to insert."		        		        pg0next.Enabled=true		        		      else		        pg0status.Text="Failed to load file."		      end		      		    CASE FileTypes1.TextCommaSeparatedValues.Name		      		      TextField2.text=obj.FolderItem.AbsolutePath		      		      segmsource=GetFolderitem(obj.FolderItem.AbsolutePath)		      		      if segmsource<>Nil then		        		        pg0status.Text="Reading "+segmsource.name+"..."		        		        self.refresh		        		        do		          		        loop until LoadSegmCSV(segmsource)		        		        if segments<>nil then		          pg4status.Text="File had "+str(segments.count)+" segments."		          		          pg4prog.value=0		          		        end		        		      else		        pg4status.Text="Failed to load file."		      end		      		    END SELECT		    		  end		End Sub	#tag EndEvent	#tag Event		Sub Open()		  me.top=200		  me.left=screen(0).width/2-me.width/2		  		  me.AcceptFileDrop(FileTypes1.ApplicationXml)		  me.AcceptFileDrop(FileTypes1.TextCommaSeparatedValues)		End Sub	#tag EndEvent	#tag Method, Flags = &h21		Private Function CountryCode(c as String) As string		  SELECT CASE UpperCase(c)		    		  CASE "BELGIUM"		    return "BE"		    		  CASE "DENMARK"		    return "DK"		    		  CASE "FINLAND"		    return "FI"		    		  CASE "GERMANY"		    return "DE"		    		  CASE "NETHERLANDS"		    return "NL"		    		  CASE "SWEDEN"		    return "SE"		    		  CASE "ESTONIA"		    return "EE"		    		  CASE "LITHUANIA"		    return "LT"		    		  CASE "LATVIA"		    return "LV"		    		  CASE "NORWAY"		    return "NO"		    		  CASE "UNITED KINGDOM"		    return "UK"		    		  CASE "UNITED STATES"		    return "US"		    		  END SELECT		  		  return c		End Function	#tag EndMethod	#tag Method, Flags = &h0		Function CreateCSV() As boolean		  dim tgt as folderitem		  dim fn,ln,lna,s,fs,duns as string		  dim tos as TextOutputStream		  dim i,j,k as integer		  dim lines(-1) as string		  		  //create header line		  		  if source<>nil then fs=source.name		  		  ln=""		  		  for i=0 to DnBDataArray(0).datarow.count-2		    		    s=DnBDataArray(0).datarow.key(i)		    		    ln=ln+s+","		    		  next		  		  s=DnBDataArray(0).datarow.key(i)		  		  ln=ln+s+",EXT_CONTACT_FIRSTNAME,EXT_CONTACT_LASTNAME,EXT_CONTACT_ROLE,SEGMENT,BUSINESS_GROUP,FILENAME,OWNERID"		  		  lines.Append(ln)		  		  //create records as lines		  		  for i=0 to uBound(DnbDataArray)		    		    //create lead of orig record (with CEO as role)		    		    if DnbDataArray(i).datarow.haskey("DUNS") then		      duns=DnbDataArray(i).datarow.value("DUNS")		    end		    		    ln=""		    		    for k=0 to DnbDataArray(i).datarow.count-2		      		      s=PrepareField(DnbDataArray(i).datarow.key(k),DnbDataArray(i).datarow.value(DnbDataArray(i).datarow.key(k)),i)		      		      //if field contains a comma -character, field must contain quotation marks		      		      if InStr(s,chr(44))>0 then		        		        s=chr(34)+s+chr(34)		        		      end		      		      ln=ln+s+","		      		    next		    		    ln=ln+PrepareField(DnbDataArray(i).datarow.key(k),DnbDataArray(i).datarow.value(DnbDataArray(i).datarow.key(k)),i)		    		    lna=ln		    		    s=DnbDataArray(i).datarow.value("CEO_TTL")		    		    if InStr(s,chr(44))>0 then		      s=chr(34)+s+chr(34)		    end		    		    ln=ln+","+PrepareField("CEO_FORENME",DnbDataArray(i).datarow.value("CEO_FORENME"),i)+","+PrepareField("CEO_SURNME",DnbDataArray(i).datarow.value("CEO_SURNME"),i)+","+s+","+SegmentString(duns)+","+bGroupMenu.Text+","+fs+","+ownerIdTF.text		    		    lines.Append(ln)		    		    //create additional leads of roles		    		    ln=""		    		    for j=0 to execRoles.count-1		      		      if execroles.value(execroles.key(j))=true then		        		        if DnbDataArray(i).datarow.value("EXEC_TITLE_DESC1")=execroles.key(j) then		          		          s=DnbDataArray(i).datarow.value("EXEC_TITLE_DESC1")		          		          if InStr(s,chr(44))>0 then		            s=chr(34)+s+chr(34)		          end		          		          ln=lna+","+PrepareField("EXEC_FORENME_1",DnbDataArray(i).datarow.value("EXEC_FORENME_1"),i)+","+PrepareField("EXEC_SURNME_1",DnbDataArray(i).datarow.value("EXEC_SURNME_1"),i)+","+s+","+SegmentString(duns)+","+bGroupMenu.Text+","+fs+","+ownerIdTF.text		          		          lines.append(ln)		          ln=""		          		        end		        		        if DnbDataArray(i).datarow.value("EXEC_TITLE_DESC2")=execroles.key(j) then		          		          s=DnbDataArray(i).datarow.value("EXEC_TITLE_DESC2")		          		          if InStr(s,chr(44))>0 then		            s=chr(34)+s+chr(34)		          end		          		          ln=lna+","+PrepareField("EXEC_FORENME_2",DnbDataArray(i).datarow.value("EXEC_FORENME_2"),i)+","+PrepareField("EXEC_SURNME_2",DnbDataArray(i).datarow.value("EXEC_SURNME_2"),i)+","+s+","+SegmentString(duns)+","+bGroupMenu.Text+","+fs+","+ownerIdTF.text		          lines.append(ln)		          ln=""		          		        end		        		        if DnbDataArray(i).datarow.value("EXEC_TITLE_DESC3")=execroles.key(j) then		          s=DnbDataArray(i).datarow.value("EXEC_TITLE_DESC3")		          if InStr(s,chr(44))>0 then		            s=chr(34)+s+chr(34)		          end		          		          ln=lna+","+PrepareField("EXEC_FORENME_3",DnbDataArray(i).datarow.value("EXEC_FORENME_3"),i)+","+PrepareField("EXEC_SURNME_3",DnbDataArray(i).datarow.value("EXEC_SURNME_3"),i)+","+s+","+SegmentString(duns)+","+bGroupMenu.Text+","+fs+","+ownerIdTF.text		          		          lines.append(ln)		          ln=""		        end		        		        if DnbDataArray(i).datarow.value("EXEC_TITLE_DESC4")=execroles.key(j) then		          s=DnbDataArray(i).datarow.value("EXEC_TITLE_DESC4")		          if InStr(s,chr(44))>0 then		            s=chr(34)+s+chr(34)		          end		          ln=lna+","+PrepareField("EXEC_FORENME_4",DnbDataArray(i).datarow.value("EXEC_FORENME_4"),i)+","+PrepareField("EXEC_SURNME_4",DnbDataArray(i).datarow.value("EXEC_SURNME_4"),i)+","+s+","+SegmentString(duns)+","+bGroupMenu.Text+","+fs+","+ownerIdTF.text		          lines.append(ln)		          ln=""		        end		        		        if DnbDataArray(i).datarow.value("EXEC_TITLE_DESC5")=execroles.key(j) then		          s=DnbDataArray(i).datarow.value("EXEC_TITLE_DESC5")		          if InStr(s,chr(44))>0 then		            s=chr(34)+s+chr(34)		          end		          ln=lna+","+PrepareField("EXEC_FORENME_5",DnbDataArray(i).datarow.value("EXEC_FORENME_5"),i)+","+PrepareField("EXEC_SURNME_5",DnbDataArray(i).datarow.value("EXEC_SURNME_5"),i)+","+s+","+SegmentString(duns)+","+bGroupMenu.Text+","+fs+","+ownerIdTF.text		          lines.append(ln)		          ln=""		        end		        		        if DnbDataArray(i).datarow.value("EXEC_TITLE_DESC6")=execroles.key(j) then		          s=DnbDataArray(i).datarow.value("EXEC_TITLE_DESC6")		          if InStr(s,chr(44))>0 then		            s=chr(34)+s+chr(34)		          end		          ln=lna+","+PrepareField("EXEC_FORENME_6",DnbDataArray(i).datarow.value("EXEC_FORENME_6"),i)+","+PrepareField("EXEC_SURNME_6",DnbDataArray(i).datarow.value("EXEC_SURNME_6"),i)+","+s+","+SegmentString(duns)+","+bGroupMenu.Text+","+fs+","+ownerIdTF.text		          lines.append(ln)		          ln=""		        end		        		        if DnbDataArray(i).datarow.value("EXEC_TITLE_DESC7")=execroles.key(j) then		          s=DnbDataArray(i).datarow.value("EXEC_TITLE_DESC7")		          if InStr(s,chr(44))>0 then		            s=chr(34)+s+chr(34)		          end		          ln=lna+","+PrepareField("EXEC_FORENME_7",DnbDataArray(i).datarow.value("EXEC_FORENME_7"),i)+","+PrepareField("EXEC_SURNME_7",DnbDataArray(i).datarow.value("EXEC_SURNME_7"),i)+","+s+","+SegmentString(duns)+","+bGroupMenu.Text+","+fs+","+ownerIdTF.text		          lines.append(ln)		          ln=""		        end		        		        if DnbDataArray(i).datarow.value("EXEC_TITLE_DESC8")=execroles.key(j) then		          s=DnbDataArray(i).datarow.value("EXEC_TITLE_DESC8")		          if InStr(s,chr(44))>0 then		            s=chr(34)+s+chr(34)		          end		          ln=lna+","+PrepareField("EXEC_FORENME_8",DnbDataArray(i).datarow.value("EXEC_FORENME_8"),i)+","+PrepareField("EXEC_SURNME_8",DnbDataArray(i).datarow.value("EXEC_SURNME_8"),i)+","+s+","+SegmentString(duns)+","+bGroupMenu.Text+","+fs+","+ownerIdTF.text		          lines.append(ln)		          ln=""		        end		        		        if DnbDataArray(i).datarow.value("EXEC_TITLE_DESC9")=execroles.key(j) then		          s=DnbDataArray(i).datarow.value("EXEC_TITLE_DESC9")		          if InStr(s,chr(44))>0 then		            s=chr(34)+s+chr(34)		          end		          ln=lna+","+PrepareField("EXEC_FORENME_9",DnbDataArray(i).datarow.value("EXEC_FORENME_9"),i)+","+PrepareField("EXEC_SURNME_9",DnbDataArray(i).datarow.value("EXEC_SURNME_9"),i)+","+s+","+SegmentString(duns)+","+bGroupMenu.Text+","+fs+","+ownerIdTF.text		          lines.append(ln)		          ln=""		        end		        		        if DnbDataArray(i).datarow.value("EXEC_TITLE_DESC10")=execroles.key(j) then		          s=DnbDataArray(i).datarow.value("EXEC_TITLE_DESC10")		          if InStr(s,chr(44))>0 then		            s=chr(34)+s+chr(34)		          end		          ln=lna+","+PrepareField("EXEC_FORENME_10",DnbDataArray(i).datarow.value("EXEC_FORENME_10"),i)+","+PrepareField("EXEC_SURNME_10",DnbDataArray(i).datarow.value("EXEC_SURNME_10"),i)+","+s+","+SegmentString(duns)+","+bGroupMenu.Text+","+fs+","+ownerIdTF.text		          lines.append(ln)		          ln=""		        end		        		      end		    next		    		  next		  		  //create file		  		  if source<>nil then		    		    tgt=source.Parent		    fn=nthfield(source.name,".",1)		    fn=Uppercase(fn)+".CSV"		    		    if tgt<>nil then		      		      tgt=tgt.Child(fn)		      		      if tgt.exists then tgt.Delete		      		      tos=TextOutputStream.Create(tgt)		      		      if uBound(lines)>-1 then		        		        for i=0 to uBound(lines)		          		          if optionUTF8.value then		            tos.WriteLine(DefineEncoding(lines(i),Encodings.UTF8))		          else		            tos.WriteLine(ConvertEncoding(lines(i),Encodings.WindowsLatin1))		          end		          		          if tos.LastErrorCode>0 then		            MsgBox "File write error "+str(tos.LastErrorCode)		          end		          		        next		        		      end		      		      tos.close		      		    end		    		  end		  		  return true		  		exception err as IOException		  MsgBox "IOException at CreateCSV method."		End Function	#tag EndMethod	#tag Method, Flags = &h21		Private Function LoadSegmCSV(f as folderitem) As Boolean		  dim t as TextInputStream		  dim i,dns,sgm as integer		  dim s,ln as string		  		  segments=New Dictionary		  		  if f<>nil then		    if f.exists then		      		      t=TextInputStream.Open(f)		      t.Encoding=Encodings.UTF8		      		      if t<>nil then		        		        //locate correct headers		        		        s=t.readall		        t.close		        s=ReplaceLineEndings(s,EndOfLine.Windows)		        		        if CountFields(s,EndOfLine)>1 then		          		          ln=NthField(s,EndOfLine,1)		          		          pg4prog.maximum=CountFields(s,EndOfLine)		          		          for i=1 to CountFields(ln,",")		            if nthField(ln,",",i)="DUNS" then dns=i		            if nthField(ln,",",i)="SEGMENT" then sgm=i		          next		          		          for i=2 to CountFields(s,EndOfLine)		            		            pg4prog.value=i		            pg4prog.Refresh		            		            ln=NthField(s,EndOfLine,i)		            segments.value(nthField(ln,",",dns))=nthField(ln,",",sgm)		          next		          		        else		          MsgBox "Error: Cannot identify line endings on CSV file."		        end		      end		    end		  end		  		  return true		End Function	#tag EndMethod	#tag Method, Flags = &h21		Private Function ParseDnbXml(f as folderitem) As boolean		  dim xdoc as XmlDocument		  dim t as TextInputStream		  dim i,j,rcount,fcount as integer		  dim k,v as string		  		  redim DnbDataArray(-1)		  		  t=TextInputStream.Open(f)		  t.Encoding=Encodings.UTF8		  		  if t<>nil then		    		    xdoc=New XmlDocument		    xdoc.PreserveWhitespace=False		    xdoc.LoadXml(t.ReadAll(Encodings.UTF8))		    		    rcount=xdoc.DocumentElement.Child(2).ChildCount		    		    for i=0 to rcount-1		      		      fcount=xdoc.DocumentElement.Child(2).Child(i).ChildCount		      		      dim dnb as New DnbData		      dim drow as New Dictionary		      		      for j=0 to fcount-1		        		        if xdoc.DocumentElement.Child(2).Child(i).Child(j)<>nil then		          		          k=xdoc.DocumentElement.Child(2).Child(i).Child(j).name		          		          if xdoc.DocumentElement.Child(2).Child(i).Child(j).FirstChild<>nil then		            v=xdoc.DocumentElement.Child(2).Child(i).Child(j).FirstChild.value		            		            if RemoveCommas.Value then		              v=ReplaceAll(v,","," ")		            end		            		          else		            v=""		          end		          		          drow.value(k)=v		          		          dnb.datarow=drow		          		        end		        		      next		      		      DnbDataArray.append dnb		      		    next		    		  end		  		  t.close		  		  //load roles		  		  execroles=New Dictionary		  		  execroles.value("CEO")="false"		  		  if uBound(DnbDataArray)>-1 then		    for i=0 to uBound(DnbDataArray)		      		      if not execroles.haskey(DnbDataArray(i).datarow.value("EXEC_TITLE_DESC1")) then		        execroles.value(DnbDataArray(i).datarow.value("EXEC_TITLE_DESC1"))=false		      end		      		    next		    		  end		  		  //populate roles view		  		  roleLB.deleteallrows		  		  for i=0 to execroles.Count-1		    		    roleLB.ColumnType(0)=Listbox.TypeCheckbox		    		    if len(execroles.key(i))>0 then		      if execroles.key(i)<>"No Title Entered" then		        roleLB.addrow("")		        roleLB.cell(roleLB.lastindex,1)=execroles.key(i)		      end		    end		    		    rolelb.SortedColumn=1		    roleLB.sort		    		  next		  		  return true		  		exception err0 as IOException		  MsgBox "IOException in ParseDnbXml"+EndOfLine+err0.message		  		exception err1 as XmlException		  MsgBox "XmlException in ParseDnbXml:"+EndOfLine+err1.message		  		exception err2 as XmlReaderException		  MsgBox "XmlReaderException in ParseDnbXml:"+EndOfLine+err2.message		End Function	#tag EndMethod	#tag Method, Flags = &h0		Function PrepareField(fname as string, fvalue as string, i as integer) As string		  //in this method we can do field-specific magic		  		  dim s as string		  		  SELECT CASE fname		    		  CASE "US_1987_SIC_CD_1"		    		    return left(DnbDataArray(i).datarow.value("US_1987_SIC_CD_1"),4)		    		  CASE "MAILING_POST_CD"		    		    if optionCountryZip.value then		      		      if len(fvalue)>0 then		        s=CountryCode(DnbDataArray(i).datarow.value("CTRY_NME"))+" "+fvalue		      else		        s=""		      end		      return s		      		    else		      		      return fvalue		      		    end		    		  CASE "POST_CD"		    		    if optionCountryZip.value then		      if len(fvalue)>0 then		        s=CountryCode(DnbDataArray(i).datarow.value("CTRY_NME"))+" "+fvalue		      else		        s=""		      end		      return s		      		    else		      		      return fvalue		      		    end		    		  CASE "FAX"		    		    if optionIntlPhone.value then		      		      if len(DnbDataArray(i).datarow.value("FAX"))>6 then		        return DnbDataArray(i).datarow.value("COUNTRY_ACCESS_CODE")+" "+DnbDataArray(i).datarow.value("FAX")		      else		        return ""		      end		    else		      		      return fvalue		      		    end		    		  CASE "PHON"		    		    if optionIntlPhone.value then		      		      if len(DnbDataArray(i).datarow.value("PHON"))>5 then		        return DnbDataArray(i).datarow.value("COUNTRY_ACCESS_CODE")+" "+DnbDataArray(i).datarow.value("PHON")		      else		        return ""		      end		    else		      		      return fvalue		      		    end		    		  CASE "EXEC_SURNME_1"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_1")		      s=NthField(s," ",CountFields(s," "))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_FORENME_1"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_1")		      s=left(s,len(s)-len(NthField(s," ",CountFields(s," "))))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_SURNME_2"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_2")		      s=NthField(s," ",CountFields(s," "))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_FORENME_2"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_2")		      s=left(s,len(s)-len(NthField(s," ",CountFields(s," "))))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_SURNME_3"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_3")		      s=NthField(s," ",CountFields(s," "))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_FORENME_3"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_3")		      s=left(s,len(s)-len(NthField(s," ",CountFields(s," "))))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_SURNME_4"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_4")		      s=NthField(s," ",CountFields(s," "))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_FORENME_4"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_4")		      s=left(s,len(s)-len(NthField(s," ",CountFields(s," "))))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_SURNME_5"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_5")		      s=NthField(s," ",CountFields(s," "))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_FORENME_5"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_5")		      s=left(s,len(s)-len(NthField(s," ",CountFields(s," "))))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_SURNME_6"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_6")		      s=NthField(s," ",CountFields(s," "))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_FORENME_6"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_6")		      s=left(s,len(s)-len(NthField(s," ",CountFields(s," "))))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_SURNME_7"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_7")		      s=NthField(s," ",CountFields(s," "))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_FORENME_7"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_7")		      s=left(s,len(s)-len(NthField(s," ",CountFields(s," "))))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_SURNME_8"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_8")		      s=NthField(s," ",CountFields(s," "))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_FORENME_8"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_8")		      s=left(s,len(s)-len(NthField(s," ",CountFields(s," "))))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_SURNME_9"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_9")		      s=NthField(s," ",CountFields(s," "))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_FORENME_9"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_9")		      s=left(s,len(s)-len(NthField(s," ",CountFields(s," "))))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_SURNME_10"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_10")		      s=NthField(s," ",CountFields(s," "))		      return s		    else		      return fvalue		    end		    		  CASE "EXEC_FORENME_10"		    		    if len(fvalue)=0 then		      s=DnbDataArray(i).datarow.value("EXEC_FULL_NME_10")		      s=left(s,len(s)-len(NthField(s," ",CountFields(s," "))))		      return s		    else		      return fvalue		    end		    		  CASE "EXT_CONTACT_LASTNAME"		    		    if len(fvalue)<3 then		      if optionPopuEmpty.value then		        return "Not available"		      else		        return ""		      end		    else		      return fvalue		    end		    		  CASE "CEO_SURNME"		    		    if len(fvalue)=0 then		      if optionPopuEmpty.value then		        return "Not available"		      else		        return ""		      end		    else		      return fvalue		    end		    		  CASE "CEO_FULL_NME"		    		    if len(fvalue)<3 then		      		      s=DnbDataArray(i).datarow.value("CEO_FORENME")+" "+DnbDataArray(i).datarow.value("CEO_SURNME")		      		      if len(s)<3 then		        s="Not available"		      end		      		      return s		      		    else		      		      return fvalue		      		    end		    		  CASE "CTRY_NME"		    		    if optionShorten.value then		      		      return CountryCode(fvalue)		      		    else		      		      return fvalue		      		    end		    		  CASE "ANNUAL_SALES_EURO"		    		    if optionRound.value then		      		      if val(fvalue)>0 then		        		        dim e as Currency		        		        e=val(fvalue)		        		        return str(e)		        		      else		        		        return ""		        		      end		      		    else		      		      return fvalue		      		    end		    		  END SELECT		  		  return fvalue		End Function	#tag EndMethod	#tag Method, Flags = &h21		Private Function SegmentString(duns as string) As string		  dim s as string		  		  if segments<>nil then		    if segments.HasKey(duns) then		      s=segments.value(duns)+";"		    end		  end		  		  if segm1.value or segm2.value or segm3.value or segm4.value then		    		    if segm1.value then s=s+segm1.Caption+";"		    if segm2.value then s=s+segm2.Caption+";"		    if segm3.value then s=s+segm3.Caption+";"		    if segm4.value then s=s+segm4.Caption+";"		    		    s=left(s,len(s)-1)		    		    return s		    		  else		    		    return ""		    		  end		End Function	#tag EndMethod	#tag Method, Flags = &h0		Sub SetExecRoles()		  for i as integer=0 to roleLB.ListCount-1		    		    if execroles.haskey(roleLB.cell(i,1)) then		      		      execroles.value(roleLB.cell(i,1))=roleLB.CellCheck(i,0)		      		    end if		    		  next		End Sub	#tag EndMethod	#tag Property, Flags = &h21		Private DnbDataArray(-1) As DnbData	#tag EndProperty	#tag Property, Flags = &h21		Private execroles As Dictionary	#tag EndProperty	#tag Property, Flags = &h21		Private Roles(-1) As string	#tag EndProperty	#tag Property, Flags = &h21		Private segments As Dictionary	#tag EndProperty	#tag Property, Flags = &h21		Private segmsource As Folderitem	#tag EndProperty	#tag Property, Flags = &h21		Private source As folderitem	#tag EndProperty#tag EndWindowCode#tag Events pg0next	#tag Event		Sub Action()		  if PagePanel1.PanelCount>pagepanel1.value then		    PagePanel1.value=PagePanel1.value+1		  else		    me.enabled=false		  end		End Sub	#tag EndEvent#tag EndEvents#tag Events pg0cancel	#tag Event		Sub Action()		  close		End Sub	#tag EndEvent#tag EndEvents#tag Events pg0browse	#tag Event		Sub Action()		  dim f as folderitem		  		  f=GetOpenFolderItem(FileTypes1.ApplicationXml)		  		  if f<>Nil then		    		    TextField1.text=f.AbsolutePath		    		    if f.exists then		      		      source=GetFolderItem(f.AbsolutePath)		      		      pg0status.Text="Parsing "+source.name+", please wait..."		      		      self.refresh		      		      do		        		      loop until ParseDnbXml(f)		      		      pg0status.Text="File has "+str(DnbDataArray.Ubound+1)+" records to insert."		      		      pg0next.Enabled=true		      		    end		  end		  		  		End Sub	#tag EndEvent#tag EndEvents#tag Events roleLB	#tag Event		Sub CellAction(row As Integer, column As Integer)		  SetExecRoles		  		  		End Sub	#tag EndEvent#tag EndEvents#tag Events pg1next	#tag Event		Sub Action()		  if PagePanel1.PanelCount>pagepanel1.value then		    PagePanel1.value=PagePanel1.value+1		  else		    me.enabled=false		  end		End Sub	#tag EndEvent#tag EndEvents#tag Events pg1back	#tag Event		Sub Action()		  if PagePanel1.value>0 then		    PagePanel1.value=PagePanel1.value-1		  else		    me.enabled=false		  end		End Sub	#tag EndEvent#tag EndEvents#tag Events pg2back	#tag Event		Sub Action()		  if PagePanel1.value>0 then		    PagePanel1.value=PagePanel1.value-1		  else		    me.enabled=false		  end		End Sub	#tag EndEvent#tag EndEvents#tag Events optionUTF8	#tag Event		Sub Action()		  app.mprefs.putboolean(me.Name,me.value)		End Sub	#tag EndEvent	#tag Event		Sub Open()		  me.value=app.mprefs.getboolean(me.name)		End Sub	#tag EndEvent#tag EndEvents#tag Events optionIntlPhone	#tag Event		Sub Action()		  app.mprefs.putboolean(me.Name,me.value)		End Sub	#tag EndEvent	#tag Event		Sub Open()		  me.value=app.mprefs.getboolean(me.name)		End Sub	#tag EndEvent#tag EndEvents#tag Events optionShorten	#tag Event		Sub Action()		  app.mprefs.putboolean(me.Name,me.value)		End Sub	#tag EndEvent	#tag Event		Sub Open()		  me.value=app.mprefs.getboolean(me.name)		End Sub	#tag EndEvent#tag EndEvents#tag Events optionRound	#tag Event		Sub Action()		  app.mprefs.putboolean(me.Name,me.value)		End Sub	#tag EndEvent	#tag Event		Sub Open()		  me.value=app.mprefs.getboolean(me.name)		End Sub	#tag EndEvent#tag EndEvents#tag Events optionCountryZip	#tag Event		Sub Action()		  app.mprefs.putboolean(me.Name,me.value)		End Sub	#tag EndEvent	#tag Event		Sub Open()		  me.value=app.mprefs.getboolean(me.name)		End Sub	#tag EndEvent#tag EndEvents#tag Events optionPopuEmpty	#tag Event		Sub Action()		  app.mprefs.putboolean(me.Name,me.value)		End Sub	#tag EndEvent	#tag Event		Sub Open()		  me.value=app.mprefs.getboolean(me.name)		End Sub	#tag EndEvent#tag EndEvents#tag Events pg3back	#tag Event		Sub Action()		  if PagePanel1.value>0 then		    PagePanel1.value=PagePanel1.value-1		  else		    me.enabled=false		  end		End Sub	#tag EndEvent#tag EndEvents#tag Events pg2next	#tag Event		Sub Action()		  if PagePanel1.PanelCount>pagepanel1.value then		    PagePanel1.value=PagePanel1.value+1		  else		    me.enabled=false		  end		End Sub	#tag EndEvent#tag EndEvents#tag Events CheckAll	#tag Event		Sub Action()		  for i as integer=0 to roleLB.ListCount-1		    if me.value then		      roleLB.CellState(i,0)=CheckBox.CheckedStates.Checked		    else		      roleLB.CellState(i,0)=CheckBox.CheckedStates.Unchecked		    end		  next		  		  SetExecRoles		End Sub	#tag EndEvent#tag EndEvents#tag Events pg4finish	#tag Event		Sub Action()		  do		  loop until CreateCSV		  		  close		End Sub	#tag EndEvent#tag EndEvents#tag Events pg4back	#tag Event		Sub Action()		  if PagePanel1.value>0 then		    PagePanel1.value=PagePanel1.value-1		  else		    me.enabled=false		  end		End Sub	#tag EndEvent#tag EndEvents#tag Events pg3next	#tag Event		Sub Action()		  if PagePanel1.PanelCount>pagepanel1.value then		    PagePanel1.value=PagePanel1.value+1		  else		    me.enabled=false		  end		End Sub	#tag EndEvent#tag EndEvents#tag Events pg4browse	#tag Event		Sub Action()		  dim f as folderitem		  		  f=GetOpenFolderItem(FileTypes1.TextCommaSeparatedValues)		  		  if f<>Nil then		    		    TextField2.text=f.AbsolutePath		    		    if f.exists then		      		      segmsource=GetFolderItem(f.AbsolutePath)		      		      pg0status.Text="Reading "+segmsource.name+"..."		      		      self.refresh		      		      do		        		      loop until LoadSegmCSV(f)		      		      if segments<>nil then		        		        pg4status.Text="File had "+str(segments.count)+" segments."		        		        pg4prog.value=0		        		      end		    end		  end		  		  		End Sub	#tag EndEvent#tag EndEvents#tag Events ownerIdTF	#tag Event		Sub Close()		  app.mprefs.putstring("OwnerID",me.text)		  		  app.mprefs.write()		End Sub	#tag EndEvent	#tag Event		Sub Open()		  me.text=app.mprefs.getstring("OwnerID")		End Sub	#tag EndEvent#tag EndEvents